package freespiritsocial.io.user.ui.activity

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import freespiritsocial.io.user.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch


class SplashAct: AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)
    }

    override fun onResume() {
        super.onResume()
        lifecycleScope.launch(Dispatchers.IO) {
            delay(2000)
            startActivity(
                Intent(
                    this@SplashAct,
                    MainAct::class.java
                ).also {
                    it.putExtras(intent.extras ?: return@also)
                }
            )
            finish()
        }
    }
}